package com.mz361.stdapi.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mz361.common.enums.StatusEnum;
import com.mz361.common.utils.StatusUtil;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 标准数据实体类
 *
 * @author niceale
 * @date 2024/04/30
 */
@lombok.Data
@Entity
@Table(name = "std_standardDynamic")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.NOT_DELETE)
public class StandardDynamic implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonIgnore
    private Long id;
    @ApiModelProperty(notes = "标准名称")
    private String title;
    @ApiModelProperty(notes = "标准英文名称")
    private String enTitle;
    @ApiModelProperty(notes = "标准类型")
    private String standardType;
    @ApiModelProperty(notes = "标准号")
    @Column(unique = true)
    private String standardNo;
    @ApiModelProperty(notes = "标准简介")
    private String ownerDept;
    @ApiModelProperty(notes = "标准状态")
    private String standardStatus;
    //标准状态标识 0：最新上线，1：即将实施，2：最新被替代，3：最新废止
    private String dynamicStatus;
    @ApiModelProperty(notes = "发布时间")
    private String publishDate;
    @ApiModelProperty(notes = "实施时间")
    private String implDate;
    @ApiModelProperty(notes = "出版语种")
    private String language;
    // 国际标准分类号
    @ApiModelProperty(notes = "国际标准分类号")
    private String ics;
    // 中国标准分类号
    @ApiModelProperty(notes = "中国标准分类号")
    private String ccs;
    // 替代以下的标准
    @ApiModelProperty(notes = "替代以下的标准")
    private String repalceStandard;
    // 被替代的标准
    @ApiModelProperty(notes = "被替代的标准")
    private String repalcedStandard;
    // 引用的标准
    @ApiModelProperty(notes = "引用的标准")
    private String referStandard;
    //采用的标准
    @ApiModelProperty(notes = "采用的标准")
    private String adoptStandard;
    //页数
    @ApiModelProperty(notes = "页数")
    private String pageNum;
    //字数
    @ApiModelProperty(notes = "字数")
    private String wordNum;
    //开本
    @ApiModelProperty(notes = "开本")
    private String format;
    //起草者
    @ApiModelProperty(notes = "起草者")
    private String draftsMan;
    //起草单位
    @ApiModelProperty(notes = "起草单位")
    private String draftsUnit;
    //归口单位
    @ApiModelProperty(notes = "归口单位")
    private String focalUnit;
    //提出部门
    @ApiModelProperty(notes = "提出部门")
    private String sueDept;
    //发布部门
    @ApiModelProperty(notes = "发布部门")
    private String pubDept;
    @ApiModelProperty(notes = "更新时间")
    @JsonIgnore
    private String updateDate;

    // 数据状态
    @JsonIgnore
    private Byte status = StatusEnum.OK.getCode();

}
